package com.whz.serial;

import lombok.extern.slf4j.Slf4j;

import java.io.*;

/**
 * @ClassName NameMainTest
 * @Description TODO
 * @Author hong-zhi
 * @Date 2021/5/26 20:48
 * @Version 1.0
 */
@Slf4j
public class NameMainTest {
    public static void main(String[] args) throws ClassNotFoundException {
        Name name = new Name("w", "h", "z");
        String filePath = "d://Name.txt";
        try (ObjectOutputStream oos =
                     new ObjectOutputStream(new FileOutputStream(filePath));
             ObjectInputStream ois =
                     new ObjectInputStream(new FileInputStream(filePath))) {
            oos.writeObject(name);
            Object stringList = ois.readObject();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
